package com.tee.service.privilege;

import java.util.List;

import com.tee.bean.privilege.Department;
import com.tee.bean.privilege.Role;
import com.tee.bean.privilege.User;
import com.tee.service.base.DAO;

public interface UserService extends DAO<User>{
	/**
	 * 通过用户名查找User
	 * @param username
	 * @return
	 */
	public User findByPhone(String phone);
	
	/**
	 * 判断用户是否存在
	 * @param username
	 * @return
	 */
	public boolean exsit(String username);
	/**
	 * 判断用户名及密码是否正确
	 * @param username
	 * @param password
	 * @param role 
	 * @return
	 */
	public boolean checkUser(String username, String password);
	
	/**
	 * 更新密码
	 * @param username 用户名
	 * @param newpassword 新密码
	 */
	public void updatePassword(String username, String newpassword);
	/**
	 * 更改用户状态
	 * @param ids
	 * @param statu
	 */
	public void setVisibleStatu(Integer[] ids, boolean statu);

	public List<User> getUsersByDepartment(Department department);
	
	public List<User> getByRole(Role role);
	
}
